package com.factory.code.repository;

import com.factory.code.repository.ent.ProjectENT;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author 朱新海
 */
@Repository
public interface ProjectRepository extends JpaRepository<ProjectENT, Integer>, JpaSpecificationExecutor<ProjectENT> {


    ProjectENT getById(Integer id);

    @Query("select ent.samples from ProjectENT ent where ent.id=?1")
    Integer getSamplesById(Integer projectId);

}
